package com.pactera.demo.base.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;

/**
 * <p>
 *
 * </p>
 *
 * @author chang.zhou
 * @version 1.0
 * @date Created in 2020/2/27 18:10
 */
@Data
public class ResourceDto {

    @NotEmpty(message = "名称为空")
    @Length(min = 2,max = 20,message = "名称长度2-20")
    private String resourceName;

    @NotEmpty(message = "URL为空")
    @Length(min = 2,max = 20,message = "URL长度2-20")
    private String uri;

    @NotEmpty(message = "请求方式为空")
    @Length(min = 3,max = 5,message = "请求方式只能是：PUT,GET,POST,DELETE")
    private String methodType;

    @Min(value = 0,message = "可选值：0-菜单，1-接口")
    @Max(value = 1,message = "可选值：0-菜单，1-接口")
    private int resourceType;

    private String parentId;
}
